Page({
    /**
     * 页面的初始数据
     */
    data: {
        swiperData: {},
        arrData: []
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        console.log('shop onLoad', options)

        // 模拟加载数据
        this.setData({
            swiperData: {
                imgUrls: [
                    'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
                    'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
                    'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
                ],
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500
            },
            arrData: [
                {
                    icon: 'https://cdn.jxb001.net/img-prize/201709/20170912182416293493.jpg',
                    price: 149,
                    title: '小米（MI）小米手环2代 只能运动手环',
                    detailUrl: '/page/shop/detail/index?id=1'
                }, {
                    icon: 'https://cdn.jxb001.net/img-prize/201709/20170927141115750082.jpg',
                    price: 2499,
                    title: '小米Note3 全网通 6GB+64GB 黑色 移动联通电信4G',
                    detailUrl: '/page/shop/detail/index?id=2'
                }, {
                    icon: 'https://cdn.jxb001.net/img-prize/201709/20170912173343144283.jpg',
                    price: 298,
                    title: '阿迪达斯（ADIDAS） 欧冠男子场上训练比赛用球',
                    detailUrl: '/page/shop/detail/index?id=3'
                }, {
                    icon: 'https://cdn.jxb001.net/img-prize/201707/20170718175204615033.jpg',
                    price: 399,
                    title: 'RAX户外徒步鞋登山鞋',
                    detailUrl: '/page/shop/detail/index?id=4'
                }, {
                    icon: 'https://cdn.jxb001.net/img-prize/201709/20170922111656137865.jpg',
                    price: 898,
                    title: '蓝堡动感单车 家用室内静音健身车D700 黑蓝色',
                    detailUrl: '/page/shop/detail/index?id=5'
                },
                {
                    icon: 'https://cdn.jxb001.net/img-prize/201709/20170922111656137865.jpg',
                    price: 898,
                    title: '蓝堡动感单车 家用室内静音健身车D700 黑蓝色',
                    detailUrl: '/page/shop/detail/index?id=5'
                }
            ]
        });
    },
    
    loadData(){
        console.log('hahaha');
        wx.stopPullDownRefresh();
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
        console.log('shop onReady')
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        console.log('shop onShow')
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {
        console.log('shop onHide')
    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {
        console.log('shop onUnload')
    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {
        this.loadData();
    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {
        console.log('shop onReachBottom')
    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
        console.log('shop onShareAppMessage')
    }
})